package com.supreme.securityserver.controller;

import com.supreme.commonboot.utils.AjaxResp;
import com.supreme.commonentity.mysql.primary.SysUser;
import com.supreme.commonmybatis.service.quick.UserOrmService;
import com.supreme.securityserver.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "user")
public class UserController {

    @Resource
    private UserOrmService userOrmService;

    @GetMapping(value = "test")
    public AjaxResp test() {
        return AjaxResp.instance("test");
    }

    @GetMapping(value = "list")
    public AjaxResp userList() {
        List<SysUser> userList = userOrmService.list();
        return AjaxResp.instance(userList);
    }
}
